package com.fwx.inner_class;

/**
 * @author : fengwenxiang
 * @date : 2022/6/16 12:23
 * @description：内部类可以实现多重继承的效果
 */
public class OutClass_MultipleExtends {
    class InnerOne extends OutOne{
        public String name(){
            return super.name();
        }
    }
    class InnerTwo extends OutTwo{
        public int age(){
            return super.age();
        }
    }
    public String name(){
        return new InnerOne().name();
    }
    public int age(){
        return new InnerTwo().age();
    }

    public static void main(String[] args) {
        OutClass_MultipleExtends om = new OutClass_MultipleExtends();
        System.out.println(om.age());
        System.out.println(om.name());
    }
}

class OutOne{
    public String name(){
        return "inner";
    }
}

class OutTwo{
    public int age(){
        return 25;
    }
}
